/**
 * 
 */

package com.pp.admin.main.client.common;

import com.google.gwt.event.dom.client.ClickHandler;
import com.pp.admin.common.client.helper.AdminButton;
import com.pp.admin.common.client.helper.Resource;

/**
 * @author pandurang
 */
public class CrudOnCreatePage extends CrudOp {

	private AdminButton save = null;

	private AdminButton cancel = null;

	public CrudOnCreatePage(boolean edit) {

		if (edit) {
			save = new AdminButton(myConstants.update(), Resource.SAVE_IMG_URL);
		} else {
			save = new AdminButton(myConstants.save(), Resource.SAVE_IMG_URL);
		}
		cancel = new AdminButton(myConstants.cancel(), Resource.CANCEL_IMG_URL);
		add(save);
		add(cancel);
	}

	public void addSaveClickHandler(ClickHandler handler) {

		save.addClickHandler(handler);
	}

	public void addCancelClickHandler(ClickHandler handler) {

		cancel.addClickHandler(handler);
	}
}
